<style>
    body{
        background: #f5f5f5;
    }
</style>
<script type="text/javascript">
    function countDown(obj,endTime){
        var time_start = new Date().getTime(); //设定当前时间
        var time_end =  parseInt(endTime); //设定目标时间
        // 计算时间差
        var time_distance = time_end - time_start;
        // 天
        var int_day = Math.floor(time_distance/86400000);
        time_distance -= int_day * 86400000;
        // 时
        var int_hour = Math.floor(time_distance/3600000);
        time_distance -= int_hour * 3600000;
        // 分
        var int_minute = Math.floor(time_distance/60000);
        time_distance -= int_minute * 60000;
        // 秒
        var int_second = Math.floor(time_distance/1000);
        // 时分秒为单数时、前面加零
        if(int_day < 10 && int_day > 0){
            int_day = "0" + int_day;
        }else if(int_day < 0){  // 日期已过
            console.log(obj);
            $(obj).text("已到期");//加载数据后，发现已经过期了，没有倒计时的必要
            return false;
        }
        if(int_hour < 10){
            int_hour = "0" + int_hour;
        }
        if(int_minute < 10){
            int_minute = "0" + int_minute;
        }
        if(int_second < 10){
            int_second = "0" + int_second;
        }
        if(int_day<=0 && int_hour<=0 && int_minute <=0 && int_second<=0){
            console.log(obj);
            $(obj).text("已到期");//加载数据后，发现已经过期了，没有倒计时的必要
            return false;
        }
        // 显示时间
        if(int_day>0){
            var result = parseInt(int_day)+"天"+int_hour+"小时"+int_minute+"分"+int_second+'秒';
        }else{
            var result = int_hour+"小时"+int_minute+"分"+int_second+'秒';
        }
        $(obj).text(result);
        // 设置定时器
        setTimeout("countDown("+"'"+obj+"'"+","+endTime+")",1000);
    }
</script>
<div class="sectionY">
    <a href="javascript:history.back()">
        <img src="__PUBLIC__/home/images/a4.png" class="a1" alt="">
    </a>
    <p class="p1">抢购详情</p>
</div>
<div class="kong1"></div>
<div class="qq_section1">
    <div class="qq_section1_1">
        <p class="pt">订单基本信息</p>
        <div class="f1 clearfix">
            <p class="p1">类型</p>
            <p class="p2">{$buyid.title}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">应付费用</p>
            <p class="p2">{$buyid.price}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">合约收益</p>
            <p class="p2">{$buyid.daynum}天/{$buyid.earnpercent}%</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">消耗共享豆</p>
            <p class="p2">{$buyid.caifen}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">预计获得收益</p>
            <p class="p2">{$buyid.dayaddprice}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">支付状态</p>
            <p class="p2">
                {if condition="$payid['paystatus'] eq 0"}未付款{/if}
                {if condition="$payid['paystatus'] eq 1"}已付款{/if}
                {if condition="$payid['paystatus'] eq 2"}已完成{/if}
            </p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">抢购时间</p>
            <p class="p2">{$buyid.ctime|date='Y-m-d H:i:s',###}</p>
        </div>
        {if condition="$payid['paystatus'] eq 0"}
        <div class="f1 clearfix">
            <p class="p1">剩余付款时间</p>
            <p class="p2 sred" id='oneTime{$payid.id}'></p>
            <?php $recive_time = ($payid['peiduitime']+config('setting.pay_limit_time')*60); ?>
            <script>countDown('#oneTime'+{$payid.id},parseInt({$recive_time}*1000));</script>
        </div>
        {/if}
        {if condition="$payid['paystatus'] eq 1"}
        <div class="f1 clearfix">
            <p class="p1">确认收款剩余时间</p>
            <p class="p2 sred" id='oneTime{$payid.id}'></p>
            <?php $recive_time = ($payid['paytime']+config('setting.sure_limit_time')*60); ?>
            <script>countDown('#oneTime'+{$payid.id},parseInt({$recive_time}*1000));</script>
        </div>
        {/if}
        <div class="f1 clearfix">
            <p class="p1">到期时间</p>
            <p class="p2">{$buyid.cansaletime|date='Y-m-d H:i:s',###}</p>
        </div>
    </div>
    <div class="qq_section1_1">
        <p class="pt">转让方收款账号信息</p>
        <div class="f1 clearfix">
            <p class="p1">用户名</p>
            <p class="p2">{$get_man.username|default=''}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">手机号</p>
            <p class="p2">{$get_man.selfphone|default=''}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">紧急联系人</p>
            <p class="p2">{$get_man.mustman|default=''}</p>
        </div>
        {if !(empty($get_man['emailname']) || empty($get_man['email']) || empty($get_man['emailcode']))}
        <div class="f1 clearfix">
            <p class="p1">账号类型</p>
            <p class="p2">支付宝</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">用户姓名</p>
            <p class="p2">{$get_man.emailname}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">支付宝账号</p>
            <p class="p2">{$get_man.email}</p>
        </div>
        <div class="ft">
            {if config("setting.paycode")==2}
            <img src="{:config('setting.alipaytpic')}" alt="1" class="show_btn">
            {else}
            <img src="{$get_man.emailcode}" alt="1" class="show_btn">
            {/if}
        </div>
        {/if}
        {if !(empty($get_man['selfqqname']) || empty($get_man['selfqq']) || empty($get_man['selfqqcode']))}
        <div class="f1 clearfix">
            <p class="p1">账号类型</p>
            <p class="p2">微信</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">用户姓名</p>
            <p class="p2">{$get_man.selfqqname}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">微信账号</p>
            <p class="p2">{$get_man.selfqq}</p>
        </div>
        <div class="ft">
            {if config("setting.paycode")==2}
            <img src="{:config('setting.wechatpic')}" alt="1" class="show_btn">
            {else}
            <img src="{$get_man.selfqqcode}" alt="1" class="show_btn">
            {/if}
        </div>
        {/if}

        {if !(empty($get_man['realname']) || empty($get_man['banktypename']) || empty($get_man['bankname']) || empty($get_man['bankcard']))}
        <div class="f1 clearfix">
            <p class="p1">账号类型</p>
            <p class="p2">银行卡</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">用户姓名</p>
            <p class="p2">{$get_man.realname}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">开户银行</p>
            <p class="p2">{$get_man.banktypename}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">开户支行</p>
            <p class="p2">{$get_man.bankname}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">银行卡号</p>
            <p class="p2">{$get_man.bankcard}</p>
        </div>
        {/if}
    </div>
    {if condition="$payid['paystatus'] gt 0"}
    <div class="qq_section1_1">
        <p class="pt">我的付款凭证</p>
        <div class="f1 clearfix">
            <p class="p1">付款方式</p>
            <p class="p2">{$payid.paytype}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">上传付款时间</p>
            <p class="p2">{$payid.paytime|date='Y-m-d H:i:s',###}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">支付宝账号</p>
            <p class="p2">{$get_man.email}</p>
        </div>
        <div class="ft">
            <img src="{$payid.payimg}" alt="2" class="show_btn">
        </div>
    </div>
    {/if}
</div>

<div class="big_img" style="display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
    <img src="" alt="" style="width: 100%;">
</div>
<script>
    $(function () {
        $(".show_btn").click(function(){
            var altval = $(this).attr('src');
            $(".big_img img").attr('src',altval);
            var dd = $(".big_img").height();
            $(".big_img").show(200);
            $(".big_img img").css("paddingTop",(dd-$(".big_img img").height())/3.5);
        })
        $(".big_img").click(function(){
            $(".big_img").hide(200);
        })
    })
</script>